package geometry;

public class Point3D {

	private double x;
	private double y;
	private double z;
	
	public Point3D()
	{
		
	}
	public Point3D(double x, double y, double z)
	{
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	public Point3D(double[] coordinates)
	{
		this.x = coordinates[0];
		this.y = coordinates[1];
		this.z = coordinates[2];
	}
	/**
	 * @return the x
	 */
	public double getX() {
		return x;
	}
	/**
	 * @return the y
	 */
	public double getY() {
		return y;
	}
	/**
	 * @return the z
	 */
	public double getZ() {
		return z;
	}
	
	public double[] getCoordinates()
	{
		return new double[]{x,y,z};
	}
	
	public static double distance(Point3D p0, Point3D p1)
	{
		return Math.sqrt(Math.pow(p1.x - p0.x, 2) + Math.pow(p1.y - p0.y, 2) +Math.pow(p1.z - p0.z, 2));
	}
}
